// BoardView.cpp : implementation file
//

#include "stdafx.h"
#include "TechniqueVerification.h"
#include "BoardView.h"
#include "JGraphOrigin.h"
#include "JBoundary.h"
#include "JPoint.h"
#include "JPaneStage.h"

// CBoardView

IMPLEMENT_DYNAMIC(CBoardView, CWnd)

CBoardView::CBoardView():
m_pRender(NULL)
{

}

CBoardView::~CBoardView()
{
}


BEGIN_MESSAGE_MAP(CBoardView, CWnd)
	ON_WM_PAINT()
	ON_WM_MOUSEMOVE()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_ERASEBKGND()
END_MESSAGE_MAP()



// CBoardView message handlers
void CBoardView::OnPaint()
{
	CPaintDC dc(this); 


	if (m_pRender)
	{
		CDC* pDC = GetDC();
		m_pRender->Show(pDC);
		ReleaseDC(pDC);
	}
}




void CBoardView::OnMouseMove(UINT nFlags, CPoint point)
{
	if (m_pRender)
	{
		m_pRender->OnMouseMove(point);
	}
	CWnd::OnMouseMove(nFlags, point);
}


void CBoardView::OnLButtonDown(UINT nFlags, CPoint point)
{
	if (m_pRender)
	{
		m_pRender->OnLButtonDown(point);
		SetCapture();
	}
	CWnd::OnLButtonDown(nFlags, point);
}


void CBoardView::OnLButtonUp(UINT nFlags, CPoint point)
{
	if (m_pRender)
	{
		m_pRender->OnLButtonUp(point);
		ReleaseCapture();
	}
	CWnd::OnLButtonUp(nFlags, point);
}


BOOL CBoardView::OnEraseBkgnd(CDC* pDC)
{
	return TRUE;
}
